//
// Created by Semir on 2020/5/11.
//

#include <iostream>

using namespace std;

int NumberOf1(int n) {
    unsigned int i = 1;
    int cnt = 0;
    while (i) {
        cnt += (n & i) != 0 ? 1 : 0;
        i = i << 1;
    }
    return cnt;
}

int main() {
    int res = NumberOf1(8);
    cout << res << endl;
    return 0;
}